#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "Task_Base/CriticalSection.h"
#include <queue>
#include <StreamBuf/StreamBuf.h>
using namespace std;
class FFMPEG_Impl;
class QFile;
class LogicImpl;
typedef struct STRUCT_YUV
{
    char y[176 *144];
    char u[176 *144/4];
    char v[176 *144/4];
} STRUCT_YUV;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

public:
    void add_rgb_buf(const CStreamBuf& buf);
protected:
    void timerEvent( QTimerEvent *event );
    void paintEvent( QPaintEvent *event );
private:
    int  m_nTimerId;

    CCriticalSection oCriSection;
    CStreamBuf  buf_show;
    std::queue<CStreamBuf>  all_rgb_buf;
private slots:
    void on_pushButton_2_clicked();

    void on_pushButton_clicked();

private:
    Ui::MainWindow *ui;

    LogicImpl  *mImpl;
};

#endif // MAINWINDOW_H
